<%--
  Created by IntelliJ IDEA.
  User: Fan307
  Date: 2016/10/25
  Time: 15:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <title>视频播放</title>
    <style type="text/css">
        body{
            background: url(/images/background3.jpg);
            background-size: 100%;
        }
        .videoplay{
            clear: both;
            display: block;
            margin: auto;
            margin-top: 30px;
        }

        @media screen and (max-width: 1000px){
            .videoplay{ width:800px; height: 600px;}
        }

        @media screen and (max-width: 500px) {
            .videoplay{ width:90%; height: 50%;}
        }
        #name{
            text-align: center;
            margin-top: 10px;
        }
        .videoplay{
            border-radius: 7px;
        }
        #back{

            float: left;
            margin-left: 70px;
        }
        #forward{
            float: right;
            margin-right: 70px;
        }
        .bottom{
            position: absolute;
            bottom: 50px;
            left: 0;
            height: 20px;
            width: 100%;
        }
    </style>
</head>
<body>
    <%
        String displayName = request.getParameter("filepath");
        System.out.println(displayName);
        Integer index = displayName.lastIndexOf('\\');
        String name = displayName.substring(index + 1) ;
    %>
    <%--视频采用相对路径播放--%>
    <br>
    <br>
    <br>
    <br>
    <video class="videoplay" controls="controls" autoplay="autoplay"
           src="<%=displayName%>">
        Sorry，您的浏览器不支持当前视频播放，请更换浏览器重新操作！
    </video>
    <div id="name"><a><%=name%></a></div>

    <%--不能播放本地资源--%>
    <%--<video controls="controls" autoplay= "autoplay" src="D:\IdeaProjects\Education\out\artifacts\Education_war_exploded\res\computer\CDUT\program\C\movie.mp4">
    </video>--%>
    <div class="bottom"><img id="back" src="/images/arrow_left_24x24.png" onclick="window.history.back()">
        <%--<img id="forward" src="/images/arrow_right_24x24.png" onclick="window.history.forward()"></div>--%>
</body>
</html>
